package com.firefly.admin.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.firefly.admin.system.entity.FySystemMenu;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FySystemMenuMapper extends BaseMapper<FySystemMenu> {
    List<FySystemMenu> getMenuListByRoleIds(@Param("roleIds") List<Long> roleIds);

    /**
     * 通过用户ID和菜单ID判断用户是否有当前菜单权限
     *
     * @param userId 用户ID
     * @param menuId 菜单ID
     * @return 条数
     */
    int selectByUserIdAndMenuId(@Param("userId") Long userId, @Param("menuId") Long menuId);
}
